package com.zyd.config;

import com.zyd.netty.DuplexNettyServer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class NettyConfig {

    @Value("${netty.server.port:9090}")
    private int port;

    @Bean
    public DuplexNettyServer nettyServer() throws Exception {
        DuplexNettyServer nettyServer = new DuplexNettyServer();
        nettyServer.setPort(port);
        return nettyServer;
    }
}
